﻿@using System.Web.UI.WebControls
@using Dogshow.Model
@using DevExpress.Web.Mvc.UI
@using Dogshow.Web.ViewModels.Korisnici
@model KorisnikViewModel
           
@Html.DevExpress().CallbackPanel(callbackSettings =>
{
    callbackSettings.Name = "cbpKorisnik";
    callbackSettings.Width = Unit.Pixel(300);
    callbackSettings.CallbackRouteValues = new { Controller = "Korisnici", Action = "KorisnikCallback" };
    callbackSettings.ClientSideEvents.BeginCallback = "onCbpKorisnikBeginCallback";
    callbackSettings.SetContent(() =>
                                    {
                                        if (Model.Korisnik is Administrator)
                                        {
                                            @Html.RenderPartial("_AdministratorForm", Model);
                                        } 
                                        else if (Model.Korisnik is KorisnikKinoloskoDrustvo)
                                        {
                                            @Html.RenderPartial("_KinoloskoDrustvoForm", Model);
                                        } 
                                        else
                                        {
                                            @Html.RenderPartial("_KorisnikForm", Model);
                                        }
                                    });

}).GetHtml()


      